#include <stdio.h>

int gcd(int a, int b) {
    while (b != 0) {
        int t = b;
        b = a % b;
        a = t;
    }
    return a;
}

int main() {
    int a, b;

    scanf("%d/%d", &a, &b);

    int c = gcd(a, b);

    printf("%d/%d\n", a / c, b / c);

    return 0;
}
